# Contributor: Henrik Riomar <henrik.riomar@gmail.com>
# Maintainer: Henrik Riomar <henrik.riomar@gmail.com>
pkgname=virt-what
pkgver=1.24
pkgrel=0
pkgdesc="Detect if we are running in a virtual machine"
url="https://people.redhat.com/~rjones/virt-what/"
arch="x86 x86_64 ppc64le aarch64"
license="GPL-2.0-or-later"
checkdepends="checkbashisms"
makedepends="automake autoconf perl-dev"
subpackages="$pkgname-doc"
source="https://people.redhat.com/~rjones/$pkgname/files/$pkgname-$pkgver.tar.gz
	0001-fix-bashisms-in-Alibaba-checks.patch
	"

prepare() {
	default_prepare

	autoreconf -ivf
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

check() {
	make check

	checkbashisms ./virt-what
}

package() {
	make install DESTDIR="$pkgdir"
}

sha512sums="
f6d14ea402f737ce45e67637076a5c11d3fcdbc64a738851fd0ffabec374074c7a9cf857719e0c8cad87b41fc4e78b825ebedafa6fa14e414a4068fca4f5d99c  virt-what-1.24.tar.gz
df0e2f4c3a9c3092b4b5a14b6f28f3bd1828f999956bcb2b17c8150b1fe7c23446d30d41def9d61e552075d388cd6a935184553ab9dcc7a785fef6051a3cca3f  0001-fix-bashisms-in-Alibaba-checks.patch
"
